home *** CD-ROM | disk | FTP | other *** search
/ Gekkan Dennou Club 140 / Gekkan Dennou Club - 2000.1 Vol. 140 (Japan).7z / Gekkan Dennou Club - 2000.1 Vol. 140 (Japan) (Track 1).bin / tools / xpicw / xpicw110.lzh / WLSource / curtain.s next >
Encoding:
Text File  |  1997-07-11  |  9.6 KB  |  464 lines

  1. *    curtain.s
  2. *        カーテン / 最高速 = 2
  3. *            by Mitsuky
  4.  
  5.     .include    DOSCALL.MAC
  6.  
  7. SPEED_MAX    equ    2
  8.  
  9.     .offset    8        * 引き数
  10. _source_ptr:    .ds.l    1
  11. _dest_ptr:    .ds.l    1
  12. _speed:        .ds.l    1
  13. _vdisp:        .ds.l    1
  14.  
  15.  
  16.     .offset    0
  17. gvram_ptr:    .ds.l    1
  18. counter:    .ds.w    1
  19. work_size:
  20.  
  21.  
  22. gpos    .macro    pos_x,pos_y
  23.     .dc.w    (pos_y*1024)+(pos_x*2)
  24.     .endm
  25.  
  26.  
  27.     .text
  28.     .even
  29.  
  30.     .dc.b    'WL10',$0d,$0a
  31.     .dc.b    'カーテン / 最高速 = 2',$0d,$0a
  32.     .dc.b    '    by Mitsuky',$0d,$0a
  33.     .dc.b    $1a
  34.     .even
  35.  
  36. curtain:
  37.     link    a6,#0
  38.     movem.l    d1-d7/a0-a5,-(sp)
  39.  
  40.     suba.l    a5,a5
  41.  
  42.     move.l    _speed(a6),d0
  43.     bmi    curtain_ask_speed
  44.     cmpi.l    #SPEED_MAX,d0
  45.     bhi    curtain_err
  46.  
  47.     tst.l    _vdisp(a6)
  48.     bmi    curtain_ask_vdisp
  49.  
  50.  
  51.     move.l    #work_size*(512/16)*(512/16),-(sp)
  52.     DOS    _MALLOC
  53.     addq.w    #4,sp
  54.     tst.l    d0
  55.     bmi    curtain_err
  56.     movea.l    d0,a5            * a5.l = ワークのアドレス
  57.  
  58.  
  59.     movea.l    _source_ptr(a6),a2    * a2.l = 転送元アドレス
  60.     movea.l    _dest_ptr(a6),a3    * a3.l = 転送先アドレス
  61.     lea.l    table2(pc),a1        * a1.l = table2 のポインタ
  62.  
  63.             * ワークの初期化
  64.     movea.l    a5,a0
  65.     move.w    #(512/16)*(512/16)-1,d0
  66.     moveq.l    #-1,d1
  67. @@:    move.w    d1,counter(a0)
  68.     lea.l    work_size(a0),a0
  69.     dbra    d0,@b
  70.  
  71.  
  72.     lea.l    appear(pc),a0
  73.     clr.w    (a0)    * 出現カウンター
  74. curtain_loop:
  75.     moveq.l    #SPEED_MAX,d1
  76.     sub.l    _speed(a6),d1
  77. @@:    move.l    _vdisp(a6),a0
  78.     jsr    (a0)
  79.     dbra    d1,@b
  80.  
  81.     sf.b    d5
  82.  
  83.  
  84.             * ワークを出現させる
  85. 1:
  86.     lea.l    appear(pc),a0
  87.     subq.w    #1,(a0)
  88.     bpl    5f
  89.     move.l    (a1)+,d0
  90.     bmi    4f
  91.  
  92.     movea.l    a5,a4            * a4.l = ワークのアドレス
  93. 2:    tst.w    counter(a4)
  94.     bmi    3f
  95.     lea.l    work_size(a4),a4
  96.     bra    2b
  97. 3:    move.l    d0,d1
  98.     andi.l    #$00ffffff,d1
  99.     move.l    d1,gvram_ptr(a4)
  100.     clr.w    counter(a4)
  101.     rol.l    #8,d0
  102.     andi.w    #$00ff,d0
  103.     movea.l    a5,a4
  104.     lea.l    appear(pc),a0
  105.     move.w    d0,(a0)
  106.     bra    1b
  107. 4:
  108.     lea.l    appear(pc),a0
  109.     move.w    #32767,(a0)
  110. 5:
  111.  
  112.     movem.l    a1,-(sp)    **
  113.  
  114.  
  115.     move.w    #(512/16)*(512/16)-1,d7    * d7.w = ループ回数
  116.     movea.l    a5,a4
  117. curtain_loop_2:
  118.     tst.w    counter(a4)
  119.     bmi    curtain_loop_2_end
  120.  
  121.  
  122.     st.b    d5
  123.  
  124.     moveq.l    #4-1,d6
  125. @@:
  126.     movea.w    counter(a4),a1
  127.     move.w    a1,d0
  128.     addq.w    #1,d0
  129.     move.w    d0,counter(a4)
  130.     add.w    a1,a1
  131.     movea.w    table(pc,a1.w),a1
  132.     adda.l    gvram_ptr(a4),a1
  133.  
  134.     movea.l    a2,a0
  135.     adda.l    a1,a0
  136.     move.w    (a0),d1
  137.     move.w    8*2(a0),d2
  138.     move.w    8*512*2(a0),d3
  139.     move.w    8*512*2+8*2(a0),d4
  140.  
  141.     movea.l    a3,a0
  142.     adda.l    a1,a0
  143.     move.w    d1,(a0)
  144.     move.w    d2,8*2(a0)
  145.     move.w    d3,8*512*2(a0)
  146.     move.w    d4,8*512*2+8*2(a0)
  147.  
  148.     dbra    d6,@b
  149.  
  150.  
  151.     move.w    counter(a4),d0
  152.     cmpi.w    #64,d0
  153.     bcs    @f
  154.     move.w    #-1,counter(a4)
  155. @@:
  156.  
  157. curtain_loop_2_end:
  158.     lea.l    work_size(a4),a4
  159.     dbra    d7,curtain_loop_2
  160.  
  161.     movem.l    (sp)+,a1    **
  162.  
  163.     tst.b    d5
  164.     bne    curtain_loop
  165.  
  166.     moveq.l    #0,d0
  167. curtain_rts:
  168.     move.l    a5,d1
  169.     beq    @f
  170.     movem.l    d0,-(sp)
  171.     pea.l    (a5)
  172.     DOS    _MFREE
  173.     addq.w    #4,sp
  174.     movem.l    (sp)+,d0
  175. @@:
  176.     movem.l    (sp)+,d1-d7/a0-a5
  177.     unlk    a6
  178.     rts
  179.  
  180.  
  181. *********************************************************
  182. table:
  183.     gpos    0,0
  184.     gpos    4,4
  185.     gpos    2,6
  186.     gpos    5,1
  187.     gpos    7,3
  188.     gpos    2,2
  189.     gpos    6,6
  190.     gpos    3,7
  191.     gpos    7,1
  192.     gpos    0,4
  193.     gpos    7,7
  194.     gpos    4,2
  195.     gpos    1,5
  196.     gpos    6,0
  197.     gpos    3,3
  198.     gpos    5,7
  199.     gpos    6,2
  200.     gpos    2,0
  201.     gpos    3,5
  202.     gpos    6,4
  203.     gpos    3,1
  204.     gpos    7,5
  205.     gpos    1,3
  206.     gpos    4,6
  207.     gpos    5,3
  208.     gpos    4,0
  209.     gpos    0,2
  210.     gpos    1,7
  211.     gpos    5,5
  212.     gpos    1,1
  213.     gpos    0,6
  214.     gpos    2,4
  215.  
  216.  
  217.     gpos    1,0
  218.     gpos    5,4
  219.     gpos    3,6
  220.     gpos    6,1
  221.     gpos    0,3
  222.     gpos    3,2
  223.     gpos    7,6
  224.     gpos    4,7
  225.     gpos    0,1
  226.     gpos    1,4
  227.     gpos    0,7
  228.     gpos    5,2
  229.     gpos    2,5
  230.     gpos    7,0
  231.     gpos    4,3
  232.     gpos    6,7
  233.     gpos    7,2
  234.     gpos    3,0
  235.     gpos    4,5
  236.     gpos    7,4
  237.     gpos    4,1
  238.     gpos    0,5
  239.     gpos    2,3
  240.     gpos    5,6
  241.     gpos    6,3
  242.     gpos    5,0
  243.     gpos    1,2
  244.     gpos    2,7
  245.     gpos    6,5
  246.     gpos    2,1
  247.     gpos    1,6
  248.     gpos    3,4
  249.  
  250.  
  251. *     0 1 2 3 4 5 6 7
  252. *    00..17..25..13.. 0
  253. *    ..29..20..03..08 1
  254. *    26..05..11..16.. 2
  255. *    ..22..14..24..04 3
  256. *    09..31..01..19.. 4
  257. *    ..12..18..28..21 5
  258. *    30..02..23..06.. 6
  259. *    ..27..07..15..10 7
  260.  
  261. *     0 1 2 3 4 5 6 7
  262. *    ..00..17..25..13 0
  263. *    08..29..20..03.. 1
  264. *    ..26..05..11..16 2
  265. *    04..22..14..24.. 3
  266. *    ..09..31..01..19 4
  267. *    21..12..18..28.. 5
  268. *    ..30..02..23..06 6
  269. *    10..27..07..15.. 7
  270.  
  271. ****    ****
  272.     .even
  273. curtain_err:
  274.     moveq.l    #-1,d0
  275.     bra    curtain_rts
  276.  
  277.  
  278. ****    ****
  279. curtain_ask_speed:
  280.     moveq.l    #SPEED_MAX,d0
  281.     bra    curtain_rts
  282.  
  283.  
  284. ****    ****
  285. curtain_ask_vdisp:
  286.     move.l    _speed(a6),d0
  287.     lea.l    ask_vdisp_table(pc),a0
  288.     add.w    d0,d0
  289.     move.w    (a0,d0.w),d0
  290.     bra    curtain_rts
  291.  
  292. ask_vdisp_table:
  293.     .dc.w    144,96,48
  294.  
  295.  
  296. table2:        *次を待つ回数(垂直同期単位)<<24|Y座標<<10|X座標<<1
  297.     .irp    %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
  298.     .dc.l    0<<24|%A<<4<<10|0<<4<<1
  299.     .endm
  300.     .dc.l    1<<24|31<<4<<10|0<<4<<1
  301.  
  302.     .irp    %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
  303.     .dc.l    0<<24|%A<<4<<10|1<<4<<1
  304.     .endm
  305.     .dc.l    1<<24|31<<4<<10|1<<4<<1
  306.  
  307.     .irp    %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
  308.     .dc.l    0<<24|%A<<4<<10|2<<4<<1
  309.     .endm
  310.     .dc.l    1<<24|31<<4<<10|2<<4<<1
  311.  
  312.     .irp    %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
  313.     .dc.l    0<<24|%A<<4<<10|3<<4<<1
  314.     .endm
  315.     .dc.l    1<<24|31<<4<<10|3<<4<<1
  316.  
  317.     .irp    %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
  318.     .dc.l    0<<24|%A<<4<<10|4<<4<<1
  319.     .endm
  320.     .dc.l    1<<24|31<<4<<10|4<<4<<1
  321.  
  322.     .irp    %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
  323.     .dc.l    0<<24|%A<<4<<10|5<<4<<1
  324.     .endm
  325.     .dc.l    1<<24|31<<4<<10|5<<4<<1
  326.  
  327.     .irp    %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
  328.     .dc.l    0<<24|%A<<4<<10|6<<4<<1
  329.     .endm
  330.     .dc.l    1<<24|31<<4<<10|6<<4<<1
  331.  
  332.     .irp    %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
  333.     .dc.l    0<<24|%A<<4<<10|7<<4<<1
  334.     .endm
  335.     .dc.l    1<<24|31<<4<<10|7<<4<<1
  336.  
  337.     .irp    %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
  338.     .dc.l    0<<24|%A<<4<<10|8<<4<<1
  339.     .endm
  340.     .dc.l    1<<24|31<<4<<10|8<<4<<1
  341.  
  342.     .irp    %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
  343.     .dc.l    0<<24|%A<<4<<10|9<<4<<1
  344.     .endm
  345.     .dc.l    1<<24|31<<4<<10|9<<4<<1
  346.  
  347.     .irp    %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
  348.     .dc.l    0<<24|%A<<4<<10|10<<4<<1
  349.     .endm
  350.     .dc.l    1<<24|31<<4<<10|10<<4<<1
  351.  
  352.     .irp    %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
  353.     .dc.l    0<<24|%A<<4<<10|11<<4<<1
  354.     .endm
  355.     .dc.l    1<<24|31<<4<<10|11<<4<<1
  356.  
  357.     .irp    %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
  358.     .dc.l    0<<24|%A<<4<<10|12<<4<<1
  359.     .endm
  360.     .dc.l    1<<24|31<<4<<10|12<<4<<1
  361.  
  362.     .irp    %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
  363.     .dc.l    0<<24|%A<<4<<10|13<<4<<1
  364.     .endm
  365.     .dc.l    1<<24|31<<4<<10|13<<4<<1
  366.  
  367.     .irp    %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
  368.     .dc.l    0<<24|%A<<4<<10|14<<4<<1
  369.     .endm
  370.     .dc.l    1<<24|31<<4<<10|14<<4<<1
  371.  
  372.     .irp    %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
  373.     .dc.l    0<<24|%A<<4<<10|15<<4<<1
  374.     .endm
  375.     .dc.l    1<<24|31<<4<<10|15<<4<<1
  376.  
  377.     .irp    %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
  378.     .dc.l    0<<24|%A<<4<<10|16<<4<<1
  379.     .endm
  380.     .dc.l    1<<24|31<<4<<10|16<<4<<1
  381.  
  382.     .irp    %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
  383.     .dc.l    0<<24|%A<<4<<10|17<<4<<1
  384.     .endm
  385.     .dc.l    1<<24|31<<4<<10|17<<4<<1
  386.  
  387.     .irp    %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
  388.     .dc.l    0<<24|%A<<4<<10|18<<4<<1
  389.     .endm
  390.     .dc.l    1<<24|31<<4<<10|18<<4<<1
  391.  
  392.     .irp    %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
  393.     .dc.l    0<<24|%A<<4<<10|19<<4<<1
  394.     .endm
  395.     .dc.l    1<<24|31<<4<<10|19<<4<<1
  396.  
  397.     .irp    %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
  398.     .dc.l    0<<24|%A<<4<<10|20<<4<<1
  399.     .endm
  400.     .dc.l    1<<24|31<<4<<10|20<<4<<1
  401.  
  402.     .irp    %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
  403.     .dc.l    0<<24|%A<<4<<10|21<<4<<1
  404.     .endm
  405.     .dc.l    1<<24|31<<4<<10|21<<4<<1
  406.  
  407.     .irp    %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
  408.     .dc.l    0<<24|%A<<4<<10|22<<4<<1
  409.     .endm
  410.     .dc.l    1<<24|31<<4<<10|22<<4<<1
  411.  
  412.     .irp    %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
  413.     .dc.l    0<<24|%A<<4<<10|23<<4<<1
  414.     .endm
  415.     .dc.l    1<<24|31<<4<<10|23<<4<<1
  416.  
  417.     .irp    %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
  418.     .dc.l    0<<24|%A<<4<<10|24<<4<<1
  419.     .endm
  420.     .dc.l    1<<24|31<<4<<10|24<<4<<1
  421.  
  422.     .irp    %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
  423.     .dc.l    0<<24|%A<<4<<10|25<<4<<1
  424.     .endm
  425.     .dc.l    1<<24|31<<4<<10|25<<4<<1
  426.  
  427.     .irp    %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
  428.     .dc.l    0<<24|%A<<4<<10|26<<4<<1
  429.     .endm
  430.     .dc.l    1<<24|31<<4<<10|26<<4<<1
  431.  
  432.     .irp    %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
  433.     .dc.l    0<<24|%A<<4<<10|27<<4<<1
  434.     .endm
  435.     .dc.l    1<<24|31<<4<<10|27<<4<<1
  436.  
  437.     .irp    %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
  438.     .dc.l    0<<24|%A<<4<<10|28<<4<<1
  439.     .endm
  440.     .dc.l    1<<24|31<<4<<10|28<<4<<1
  441.  
  442.     .irp    %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
  443.     .dc.l    0<<24|%A<<4<<10|29<<4<<1
  444.     .endm
  445.     .dc.l    1<<24|31<<4<<10|29<<4<<1
  446.  
  447.     .irp    %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
  448.     .dc.l    0<<24|%A<<4<<10|30<<4<<1
  449.     .endm
  450.     .dc.l    1<<24|31<<4<<10|30<<4<<1
  451.  
  452.     .irp    %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
  453.     .dc.l    0<<24|%A<<4<<10|31<<4<<1
  454.     .endm
  455.     .dc.l    1<<24|31<<4<<10|31<<4<<1
  456.  
  457.  
  458.     .dc.l    32767<<24        * 終端フラグ
  459.  
  460.  
  461. appear:
  462.     .ds.w    1
  463.  
  464.